<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;
// use yii\bootstrap5\Html;
// use yii\bootstrap5\ActiveForm;
use common\models\User;
/* @var $this yii\web\View */
/* @var $model common\models\Comment */
/* @var $form yii\widgets\ActiveForm */

?>


<div class="comment-form">
  
     <?php $form = ActiveForm::begin([
    		'action'=>['post/detail','id'=>$id,'#'=>'comments'],
    		'method'=>'post',
    		]); ?> 

    
    <!-- <div class="row">
    	<div class="col-md-12"><?= $form->field($commentModel,'content')->textarea(['row'=>6])?></div>
    </div> -->

    <?php if(!empty($userMe->write_info) && !empty($model->info)) {?>
    <br>
    <div class="alert alert-warning alert-dismissible" role="alert">
        
        <h4><?=$userMe->username?>您已报名笔试，考点：<?=$userMe->write_info?></h4>
        
        <p><?= nl2br($commentModel->content);?></p>
        <span class="glyphicon glyphicon-time" aria-hidden="true"></span><em><?= date('Y-m-d H:i:s',$model->create_time)."&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";?></em>
	</div>			
	<?php }?>

    <?=$form->field($userMe,'write_info')->hiddenInput()->label(false)?>


    <div class="form-group">
        
        <?= Html::submitButton('报名笔试', [
            'class' =>'btn btn-primary',
            'onclick' => 'return confirm("' . (empty($userMe->write_info) ? '请确认你的信息:\n姓名：' . $userMe->username . '\n性别：' . $userMe->gender . '\n邮箱：' . $userMe->email . '\n考号：'.$userMe->id .' \n考点：'.$model->info : '您已报名，请勿重复报名') . '");'
            ]) ?>
        <?= Html::submitButton('报名口试', [
            'class' =>'btn btn-primary',
            'onclick' => 'return confirm("' . (empty($userMe->pro_info) ? '请确认你的信息:\n姓名：' . $userMe->username . '\n性别：' . $userMe->gender . '\n邮箱：' . $userMe->email . '\n考号：'.$userMe->id .' \n考点：'.$model->info : '您已报名，请勿重复报名') . '");'
            ]) ?>
    </div>  



     <?php ActiveForm::end(); ?> 
     

    <!-- 

    <form method="post" action="<?= Yii::$app->urlManager->createUrl(['post/detail', 'id' => $id, '#' => 'comments']); ?>">
        

        <div class="form-group">
            <input type="submit" value="我要报名" class="btn btn-primary" name="submit" onclick="return confirm('报名成功，请确认你的信息:\n姓名：\n性别：n邮箱：\n考号：')">
            
            <input type="hidden" value="1" name="gender">
        </div>
    </form>

</div>

//$form->field($userMe,'username')->label('Username')->staticInput()
//$form->field($userMe,'username')->hiddenInput()->label(false)
